/****************************************************************************\
*                                                                            *
*  Copyright 2008 The CAnt2 Project (http://code.google.com/p/cant2)         *
*                                                                            *
*  Licensed under the Apache License, Version 2.0 (the "License");           *
*  you may not use this file except in compliance with the License.          *
*  You may obtain a copy of the License at                                   *
*                                                                            *
*      http://www.apache.org/licenses/LICENSE-2.0                            *
*                                                                            *
*  Unless required by applicable law or agreed to in writing, software       *
*  distributed under the License is distributed on an "AS IS" BASIS,         *
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  *
*  See the License for the specific language governing permissions and       *
*  limitations under the License.                                            *
*                                                                            *
\****************************************************************************/

#ifndef INCLUDED_FASTBOOLEANTYPE_H__
#define INCLUDED_FASTBOOLEANTYPE_H__

namespace FastBoolean {

    // This file is probably machine/compiler specific.

    // Under the x86 ISA with VC8(VS2005), using a character as a boolean 
    // type resulted in improved performance of certain time critical 
    // code (especially code meant to be "branchless").  Disassembly 
    // revealed extra instructions when using the built-in bool type to 
    // ensure that the boolean was only ever zero or one.  Using a 
    // character removes enforcment by the compiler, however it must then 
    // be enforced by the programmer.

    typedef char bool_t;

    const bool_t True  = 1;
    const bool_t False = 0;

}

#endif /* #ifndef INCLUDED_FASTBOOLEANTYPE_H__ */

